import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useLanguageStore = defineStore(
  'language',
  () => {
    const language = ref<'zh-cn' | 'en'>('zh-cn')
    const changeLang = (value: 'zh-cn' | 'en') => {
      language.value = value
    }
    return {
      language,
      changeLang
    }
  },
  {
    persist: true
  }
)
